<?php 
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
defined('_JEXEC') or die('Restricted access'); 

JFilterOutput::objectHTMLSafe($this->row, ENT_QUOTES);	
$payment = $this->payment;
JHTML::_('behavior.tooltip');
?>
<script type="text/javascript" language="javascript">
function change_custom(is_checked,obj_id)
{
	if (obj_id=='custom_payment_pending_mail')
	{
		if (!is_checked)
			$('span_custom_payment_pending_mail').setStyle("display","none");
		else
			$('span_custom_payment_pending_mail').setStyle("display","block");
	}
	else
	{
		if (!is_checked)
			$('span_custom_payment_completed_mail').setStyle("display","none");
		else
			$('span_custom_payment_completed_mail').setStyle("display","block");
	}
}
</script>

<?php
$style_span1 = $this->row->custom_payment_pending_mail?'style="display:block;float:right;"':'style="display:none;float:right;"';
$style_span2 = $this->row->custom_payment_completed_mail?'style="display:block;float:right;"':'style="display:none;float:right;"';
if(isset($this->error)){
	$count=count($this->error);
	if($this->result==false)
		$class="error";
	else 
		$class="message";
	if($count>0)
	{
		?>
			<dl id="system-message">
				<dt class="<?php echo $class;?>"><?php echo JText::_('Message')?></dt>
				<dd class="<?php echo $class;?> message fade">
					<ul>
						<?php
							for($i=0;$i<$count;$i++)
							{
						?>
							<li><?php echo $this->error[$i];?></li>
						<?php
							}
						?>
					</ul>
				</dd>
			</dl>		
		<?php
	}
}
?>
</div>

<form action="index.php" method="post" id='adminForm' name='adminForm' class="content-right">
	<div class="col width-60" style="width: 80%">
		<fieldset class="adminform">
			<legend><?php echo JText::_( 'DETAILS' ); ?></legend>
			<table class="admintable" width="100%">	
				<tr>
					<td class="key">
						<label id="titlemsg" for="project">
							<?php echo JText::_( 'NAME' ); ?>
						</label>
					</td>
					<td>		
						<input type="text" id='namex' name='namex' size="30" disabled value="<?php echo $this->row->name;?>">
					</td>
				</tr>
				<tr>
					<td class="key">
						<label >
							<?php echo JText::_( 'Title' ); ?>
						</label>
					</td>
					<td>			
							<input type="text" id='alias' size="80" name='alias' value="<?php echo $this->row->alias; ?>">			
					</td>
				</tr>				
				<tr>
					<td  class="key">
						<?php echo JText::_( 'ENABLE' ); ?>:						
					</td>
					<td>
						<?php echo JHTML::_('select.booleanlist',  'published', 'class="inputbox"', $this->row->published);?>						
					</td>
				</tr>																															
				<?php $payment->config_form(); ?>
				
				
			</table>
		</fieldset>		
		
		<br />
		<fieldset class="adminform">
			<legend><?php echo JText::_( 'E-Mail Settings' ); ?></legend>
			<table class="admintable">
				<tr>
					<td class="key">					
						<label for="title" style="width: 150px" class="editlinktip hasTip" title="<?php echo JText::_( 'Use Customized Payment Pending E-Mail' ); ?>::<?php echo JText::_( 'use special e-mail message for this payment gateway' ); ?>">
							<?php echo JText::_( 'Use Customized Payment Pending E-Mail' ); ?>:					
						</label>						
					</td>
					<td>
						<input onclick="change_custom(this.checked,this.id)" type="checkbox" value="1" name="custom_payment_pending_mail" id="custom_payment_pending_mail" <?php if($this->row->custom_payment_pending_mail) echo "checked";?>/>
						<span id="span_custom_payment_pending_mail" <?php echo $style_span1; ?>>
							<a onclick="window.open(this.href, 'mywindow','width=600,height=600,resizable=1,scrollbars=yes'); return false;" href="index.php?option=<?php echo $this->option; ?>&view=jaemail&task=edit&paysys_id=<?php echo $this->row->id;?>&tpl=send_payment_pending_mail&title=<?php echo JText::_('Order Pending'). ' ('. $this->row->alias. ')'?>">Edit E-Mail Template</a>
						</span>
					</td>
				</tr>
				<tr>
					<td class="key">
						<label for="title" style="width: 150px" class="editlinktip hasTip" title="<?php echo JText::_( 'Use Customized Payment Receipt E-Mail' ); ?>::<?php echo JText::_('use special receitp e-mail message for this payment gateway. Send after the user purchase (not first signup)');?>">
							<?php echo JText::_( 'Use Customized Payment Receipt E-Mail' ); ?>:					
						</label>
						
					</td>
					<td>
						<input onclick="change_custom(this.checked,this.id)" type="checkbox" value="1" name="custom_payment_completed_mail" id="custom_payment_completed_mail" <?php if($this->row->custom_payment_completed_mail) echo "checked";?>/>
						<span id="span_custom_payment_completed_mail" <?php echo $style_span2; ?>>
							<a target="_blank" href="index.php?option=<?php echo $this->option; ?>&view=jaemail&task=edit&paysys_id=<?php echo $this->row->id; ?>&tpl=send_payment_completed_mail&title=<?php echo JText::_('Payment Completed'). ' ('. $this->row->alias. ')'?>">Edit E-Mail Template</a>
						</span>
					</td>
				</tr>
			</table>
		</fieldset>
		
		<?php $payment->more_info(); ?>		
			
		</div>
		<input type="hidden" name="id" id="id" value="<?php echo $this->row->id;?>">
		<input type="hidden" name="option" value="com_jajobboard" />
		<input type="hidden" name="name" value="<?php echo $this->row->name;?>" />
		<input type="hidden" name="view" value="japaymentconfig" />
		<input type="hidden" name="task" value="" />
		<?php echo JHTML::_( 'form.token' ); ?>	
</form>
